//
//  CXDestinationMissViewController.m
//  Travel
//
//  Created by dllo on 15/11/30.
//  Copyright © 2015年 doll. All rights reserved.
//

#import "CXDestinationMissViewController.h"
#import <WebKit/WebKit.h>


@interface CXDestinationMissViewController ()<WKNavigationDelegate, WKUIDelegate>

@property (nonatomic, strong) WKWebView *wkWeb;

@end

@implementation CXDestinationMissViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    //if ([[UIDevice currentDevice].systemVersion floatValue] > 8.0) {
    if ([self.str_url hasSuffix:@"experience/"]) {
        self.wkWeb = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
    }else{
        self.wkWeb = [[WKWebView alloc] initWithFrame:CGRectMake(0, -44, WIDTH, HEIGHT + 44)];
    }
    [self.view addSubview:self.wkWeb];
    
    self.wkWeb.UIDelegate = self;
    self.wkWeb.navigationDelegate = self;
    
    [self.wkWeb loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.str_url]]];
    
    [CXLoadMBProgress loadMBProgress:self.view];
}

- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
{
    [CXLoadMBProgress removeMBProgress:self.view];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
